<%@page import="com.framework.entity.Global" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<style>
.am-topbar a {
	color: #fff;
}

.am-topbar-nav>li.am-active>a,.am-topbar-nav>li.am-active>a:focus,.am-topbar-nav>li.am-active>a:hover
	{
	border-radius: 0;
	color: #fff;
	background: 0 0;
}
</style>
<!-- 头部开始 -->
<header class="am-topbar admin-header am-header-fixed"
	style="z-index:1000; background-color:#09c; color:#fff;">
	<div class="am-topbar-brand">
		<strong>扬州任务调度器管理系统</strong> <small></small>
	</div>
	<button
		class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only"
		data-am-collapse="{target: '#topbar-collapse'}">
		<span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span>
	</button>

	<div class="am-collapse am-topbar-collapse" id="topbar-collapse">

		<ul
			class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
			<!-- <li><a href="javascript:;" id="messageBox">
					<span class="am-icon-envelope-o"></span>
					收件箱 <span class="am-badge am-badge-warning">5</span>
				</a>
			</li> -->
			<li class="am-dropdown" data-am-dropdown><a
				class="am-dropdown-toggle" data-am-dropdown-toggle
				href="javascript:"> <span class="am-icon-users"></span> <%=session.getAttribute(Global.USER_NAME).toString() %> <span
					class="am-icon-caret-down"></span> </a>
				<ul class="am-dropdown-content">
					<li><a href="#" id="myPwd"><span class="am-icon-user-secret"></span>
							密码</a>
					</li>
					</li>
					<li><a
						href="${pageContext.request.contextPath}/user/logout.action"><span
							class="am-icon-power-off"></span> 退出</a>
					</li>
				</ul></li>
			<li class="am-hide-sm-only"><a href="javascript:"
				id="admin-fullscreen"><span class="am-icon-arrows-alt"></span> <span
					class="admin-fullText">开启全屏</span>
			</a>
			</li>
		</ul>
	</div>
</header>
<!-- 头部结束 -->
<script type="text/javascript">
	//资料查看
	$("#myInfo").click(function() {
		$("#doc-modal-10").modal('open');
	});
	
	//密码修改
	$("#myPwd").click(function() {
		$("#doc-modal-11").modal('open');
	});
	
	function doChangePwd()
	{
		var old_pwd=$("#old_pwd_change").val();
		var new_pwd1=$("#new_pwd_change1").val();
		var new_pwd2=$("#new_pwd_change2").val();
		var isok=true;
		if(new_pwd1!=new_pwd2){
			isok=false;
			alert("两次输入的密码不一致!");
		}
	 	if(isok){
			$.ajax({
						url:'${pageContext.request.contextPath}/user/doChangePwd.action?oldpwd='+old_pwd+'&newpwd='+new_pwd1,
						type: 'post',
						async : false,
						success:function(data){	
							if(data=="\"success\""){
								alert("修改成功!");
								$("#doc-modal-11").modal('close');
								window.location.href="${pageContext.request.contextPath}/user/logout.action";
							}
							else if(data=="\"wrongpwd\""){
							alert("修改失败!旧密码错误!");
							}
							else if(data=="\"fail\""){
							alert("修改失败!");
							}
						}
			});
		}
	}
	//收件箱查看
	$("#messageBox").click(function (){
		window.location.href="${pageContext.request.contextPath}/jsp/my/message.jsp";
	});
</script>

<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-10">
	<div class="admin-content">
		<div class="am-cf am-padding">
			<div class="am-fl am-cf">
				<strong class="am-text-primary am-text-lg">我的资料</strong>
			</div>
		</div>
		<div class="am-tabs am-margin">
			<div class="am-u-sm-12 djzjsxtc">
				<div class="am-u-sm-4 am-text-center">用户名称：</div>
				<div class="am-u-sm-8">
					<span>xxx</span>
				</div>
			</div>
			<div class="am-u-sm-12 djzjsxtc">
				<div class="am-u-sm-4 am-text-center">用户角色：</div>
				<div class="am-u-sm-8">
					<span>xxx</span>
				</div>
			</div>
			<div class="am-u-sm-12 djzjsxtc">
				<div class="am-u-sm-4 am-text-center">联系方式：</div>
				<div class="am-u-sm-8">
					<span>xxx</span>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="am-margin am-text-right">
			<button type="button" class="am-btn am-btn-primary am-btn-xs"
				data-am-modal-close>确&nbsp;&nbsp;&nbsp;定</button>
		</div>
	</div>
</div>
<!-- 密码修改开始 -->
<!--修改弹出 start-->
            <div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-11" >
                <div class="admin-content">
                    <div class="am-cf am-padding">
                      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">密码</strong> / <small>修改</small></div>
                    </div>
                  
                    <div class="am-tabs am-margin">
                          <div class="am-u-sm-12 passchange">
                              <div class="am-u-sm-4 am-text-center">
                                  	原密码
                              </div>
                              <div class="am-u-sm-8"> 
                                  <div class="am-form-icon am-form-feedback"> 
                                    <input type="password" id="old_pwd_change" class="am-form-field">
                                    <span class="am-icon-unlock" style="color:#0e90d2"></span>
                                  </div>
                              </div>
                          </div>
                          <div class="am-u-sm-12 passchange">
                              <div class="am-u-sm-4 am-text-center">
                                	 新密码
                              </div>
                              <div class="am-u-sm-8"> 
                                  <div class="am-form-icon am-form-feedback"> 
                                    <input type="password" id="new_pwd_change1" class="am-form-field">
                                    <span class="am-icon-pencil" style="color:#0e90d2"></span>
                                  </div>
                              </div>
                          </div>
                          <div class="am-u-sm-12 passchange">
                              <div class="am-u-sm-4 am-text-center">
                                	  确认新密码
                              </div>
                              <div class="am-u-sm-8"> 
                                  <div class="am-form-icon am-form-feedback"> 
                                    <input type="password" id="new_pwd_change2" class="am-form-field">
                                    <span class="am-icon-lock" style="color:#0e90d2"></span>
                                  </div>
                              </div>
                          </div>
                        <div class="clear"></div>
                    </div>
                  
                    <div class="am-margin am-text-right">
                      <button type="button" onclick="doChangePwd()" class="am-btn am-btn-primary am-btn-xs">确定</button>
                      <button type="button" class="am-btn am-btn-primary am-btn-xs" data-am-modal-close>取消</button>
                    </div>
                </div>
            </div>
   <!--修改弹出 end-->
<!-- 密码修改结束 -->
</body>

